package org.csu.onlineedubackend.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.csu.onlineedubackend.entity.CourseStudentComment;

/**
 * Mapper interface for CourseStudentComment entity
 * This is a backup implementation that uses explicit SQL to avoid field mapping issues
 */
@Mapper
public interface CourseStudentCommentMapper extends BaseMapper<CourseStudentComment> {
    
    @Select("SELECT id, course_id, student_id, content, stars, like_count, created_at, status " +
           "FROM course_comment ${ew.customSqlSegment}")
    IPage<CourseStudentComment> selectCommentPage(IPage<CourseStudentComment> page, 
                                         @Param(Constants.WRAPPER) Wrapper<CourseStudentComment> queryWrapper);
} 